<script type="text/javascript">
	function saveAndCloseModel(type) 
	{
       	if(diag)
       	{
       		var isEdit = ${(isEdit?c)!};
       		if(type == "closeEditor")
       		{	
       			<#if isEdit == true>
       				messageShow = "你确认要取消编辑模版?";
       			<#else>
       				messageShow = "你确认要取消创建模版?";
       			</#if>
	       		$.messager.confirm('询问',messageShow,function(r){
		        	if (r){
		        		<#if isEdit == false>
			                $.post('modeler.do?modelerRemove',{ids:'${(modelId)!}'},function(result){
			                    if (result.success){
			                    	reloadModeler();
			            			diag.dialog('close');    
			                    }
			                    showMsg("取消编创建模版成功");
			                },'json');
			            <#else>
			            	reloadModeler();
			    			showMsg("取消编辑模版成功");
			    			diag.dialog('close'); 
		        		</#if>
		            }
		        });
       		}
       		else if(type == "saveAndClose")
       		{
       			reloadModeler();
       			showMsg("保存模版成功")
			    diag.dialog('close'); 
       		}
       	}
	}
</script>
<iframe  src="static/oa/widgets/modeler/modeler.html?modelId=${(modelId)!}" class="panel-iframe" frameborder="0" width="100%" height="100%" marginwidth="0px" marginheight="0px" scrolling="auto"></iframe>